/**
 * LimiteFuncionario LimiteFuncionario.java
 */

package CCT220_Trabalho05_13106_Q2.view;


import javax.swing.JOptionPane;


/**
 * </br>******************************
 * </br>Project: CCT220
 * </br>Package: CCT220_Trabalho05_13106_Q2.view
 * </br>Class: LimiteFuncionario
 * </br>Last Change: 11/10/2011 22:39:01 by marcel
 * </br>Description: View of the entity of Funcionario
 * </br>******************************</br>
 * 
 * @author marcel
 * @author 13106
 * 
 */
public class LimiteFuncionario {

	/**
	 * </br>******************************
	 * </br>Package: CCT220_Trabalho05_13106_Q2.view
	 * </br>Class: LimiteFuncionario
	 * </br>Method: montaMenuPrincipal
	 * </br>Last Change: 11/10/2011 22:48:24 by marcel
	 * </br>Description:
	 * </br>******************************</br>
	 * 
	 * @return nChoice
	 */
	public int montaMenuPrincipal() {

		int nChoice = 0;
		do {
			try {
				String strChoice = JOptionPane
				        .showInputDialog(
				                null,
				                "Escolha uma das opcoes:"
				                        + "\n1-Inserir Funcionario"
				                        + "\n2-Inserir ponto mensal para um funcionario"
				                        + "\n3-Impressao da folha de pagamento de um mes"
				                        + "\n4-Sair", "Escolha",
				                JOptionPane.QUESTION_MESSAGE);
				nChoice = Integer.parseInt(strChoice);
			} catch (Exception exc) {
			}
		} while ((nChoice < 1) || (nChoice > 5));
		return nChoice;
	}


	/**
	 * </br>******************************
	 * </br>Package: CCT220_Trabalho05_13106_Q2.view
	 * </br>Class: LimiteFuncionario
	 * </br>Method: montaMenuAddFuncionario
	 * </br>Last Change: 11/10/2011 22:53:22 by marcel
	 * </br>Description:
	 * </br>******************************</br>
	 * 
	 * @return true if Professor else TecAdmin
	 */
	public boolean montaMenuAddFuncionario() {

		Object list[] = new Object[] { "Professor", "TecAdmin" };
		String opc = (String) JOptionPane.showInputDialog(null,
		        "Que tipo de Funcionario deseja usar?", "Escolha",
		        JOptionPane.QUESTION_MESSAGE, null, list, 0);
		if (opc.equals("TecAdmin")) { return false; }
		return true;
	}


	/**
	 * </br>******************************
	 * </br>Package: CCT220_Trabalho05_13106_Q2.view
	 * </br>Class: LimiteFuncionario
	 * </br>Method: captureProfessorData
	 * </br>Last Change: 11/10/2011 23:06:42 by marcel
	 * </br>Description:
	 * </br>******************************</br>
	 * 
	 * @return String[]
	 */
	public String[] captureProfessorData() {

		String ret[] = new String[] { "", "", "", "", "" };
		ret[0] = JOptionPane.showInputDialog(null, "Codigo", "Dados Professor",
		        JOptionPane.QUESTION_MESSAGE);
		ret[1] = JOptionPane.showInputDialog(null, "Nome", "Dados Professor",
		        JOptionPane.QUESTION_MESSAGE);
		ret[2] = JOptionPane.showInputDialog(null, "Titulo", "Dados Professor",
		        JOptionPane.QUESTION_MESSAGE);
		ret[3] = JOptionPane.showInputDialog(null, "SalarioHora",
		        "Dados Professor", JOptionPane.QUESTION_MESSAGE);
		ret[4] = JOptionPane.showInputDialog(null, "Numero de Aulas",
		        "Dados Professor", JOptionPane.QUESTION_MESSAGE);
		return ret;
	}


	/**
	 * </br>******************************
	 * </br>Package: CCT220_Trabalho05_13106_Q2.view
	 * </br>Class: LimiteFuncionario
	 * </br>Method: captureTecAdminData
	 * </br>Last Change: 11/10/2011 23:07:10 by marcel
	 * </br>Description:
	 * </br>******************************</br>
	 * 
	 * @return String[]
	 */
	public String[] captureTecAdminData() {

		String ret[] = new String[] { "", "", "", "" };
		ret[0] = JOptionPane.showInputDialog(null, "Codigo", "Dados TecAdmin",
		        JOptionPane.QUESTION_MESSAGE);
		ret[1] = JOptionPane.showInputDialog(null, "Nome", "Dados TecAdmin",
		        JOptionPane.QUESTION_MESSAGE);
		ret[2] = JOptionPane.showInputDialog(null, "Funcao", "Dados TecAdmin",
		        JOptionPane.QUESTION_MESSAGE);
		ret[3] = JOptionPane.showInputDialog(null, "SalarioMensal",
		        "Dados TecAdmin", JOptionPane.QUESTION_MESSAGE);
		return ret;
	}


	/**
	 * </br>******************************
	 * </br>Package: CCT220_Trabalho05_13106_Q2.view
	 * </br>Class: LimiteFuncionario
	 * </br>Method: selectCode
	 * </br>Last Change: 11/10/2011 23:15:53 by marcel
	 * </br>Description:
	 * </br>******************************</br>
	 * 
	 * @param codeList
	 * @return a code
	 */
	public int selectCode(String codeList) {

		int x = Integer.parseInt(JOptionPane.showInputDialog(null,
		        "Escolha um dos valores:\n\n" + codeList, "Dados",
		        JOptionPane.QUESTION_MESSAGE));
		return x;
	}


	/**
	 * </br>******************************
	 * </br>Package: CCT220_Trabalho05_13106_Q2.view
	 * </br>Class: LimiteFuncionario
	 * </br>Method: getMonthPoint
	 * </br>Last Change: 11/10/2011 23:19:39 by marcel
	 * </br>Description:
	 * </br>******************************</br>
	 * 
	 * @return String[]
	 */
	public String[] getMonthPoint() {

		String ret[] = new String[] { "", "", "", "" };
		ret[0] = JOptionPane.showInputDialog(null, "Mes", "Ponto",
		        JOptionPane.QUESTION_MESSAGE);
		ret[1] = JOptionPane.showInputDialog(null, "Ano", "Ponto",
		        JOptionPane.QUESTION_MESSAGE);
		ret[2] = JOptionPane.showInputDialog(null, "Faltas", "Ponto",
		        JOptionPane.QUESTION_MESSAGE);
		ret[3] = JOptionPane.showInputDialog(null, "Atrasos", "Ponto",
		        JOptionPane.QUESTION_MESSAGE);
		return ret;
	}


	/**
	 * </br>******************************
	 * </br>Package: CCT220_Trabalho05_13106_Q2.view
	 * </br>Class: LimiteFuncionario
	 * </br>Method: selectMonth
	 * </br>Last Change: 11/10/2011 23:29:12 by marcel
	 * </br>Description:
	 * </br>******************************</br>
	 * 
	 * @return String[]
	 */
	public String[] selectMonth() {

		String ret[] = new String[] { "", "" };
		ret[0] = JOptionPane.showInputDialog(null, "Mes", "Folha",
		        JOptionPane.QUESTION_MESSAGE);
		ret[1] = JOptionPane.showInputDialog(null, "Ano", "Folha",
		        JOptionPane.QUESTION_MESSAGE);
		return ret;
	}

}
